using System.Globalization;
using System.Runtime.CompilerServices;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class CanvasScalerScript : MonoBehaviour
{
     public CanvasScaler canvasScaler;
    // Start is called before the first frame update
    void Start()
    {
        AdjustMatchValue();
        
        
    }


    void AdjustMatchValue()
    {
        float aspectRatio = (float)Screen.width / Screen.height;
        // float matchValue = 0.5f;
        print("aspectRatio" + aspectRatio);
        if (aspectRatio > 0.5f)
        {
            canvasScaler.matchWidthOrHeight = 1.0f;
        }
        else if (aspectRatio < 0.5f)
        {
            canvasScaler.matchWidthOrHeight = 0.0f;
        }
        
    }


    // Update is called once per frame
    void Update()
    {
        
    }
}
